home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 December / chip-cd_2006_12.zip / 12 / Pakiet internetowy / Klienci P2P / BitTorrent / Azureus 2.5.0.0 / Azureus_2.5.0.0_Win32.setup.exe / swt.jar / patches.txt
Text File  |  2006-07-02  |  4KB  |  103 lines

  1. # Patch for SWT 3.2 final (build 3232) source code
  2. # This patch fixes 2 sets of GDI leaks in Windows 98
  3. #
  4. diff -u6r org/eclipse/swt/custom/CTabFolder.java org/eclipse/swt/custom/CTabFolder.java
  5. --- org/eclipse/swt/custom/CTabFolder.java    2005-12-13 11:18:10.000000000 +0900
  6. +++ org/eclipse/swt/custom/CTabFolder.java    2006-01-19 16:20:58.000000000 +0900
  7. @@ -768,12 +768,13 @@
  8.          } else {
  9.              gc.drawLine(x1, y2, x2, y2); // bottom
  10.          }
  11.      }
  12.  }
  13.  
  14. +// XXX TuxPaper: store gc's font and restore  (Win98 Resource Leak)
  15.  void drawChevron(GC gc) {
  16.      if (chevronRect.width == 0 || chevronRect.height == 0) return;
  17.      // draw chevron (10x7)
  18.      Display display = getDisplay();
  19.      Point dpi = display.getDPI();
  20.      int fontHeight = 72 * 10 / dpi.y;
  21. @@ -796,56 +797,62 @@
  22.      }
  23.      String chevronString = count > 99 ? "99+" : String.valueOf(count); //$NON-NLS-1$
  24.      switch (chevronImageState) {
  25.          case NORMAL: {
  26.              Color chevronBorder = single ? getSelectionForeground() : getForeground();
  27.              gc.setForeground(chevronBorder);
  28. +            Font oldFont = gc.getFont();
  29.              gc.setFont(f);
  30.              gc.drawLine(x,y,     x+2,y+2);
  31.              gc.drawLine(x+2,y+2, x,y+4);
  32.              gc.drawLine(x+1,y,   x+3,y+2);
  33.              gc.drawLine(x+3,y+2, x+1,y+4);
  34.              gc.drawLine(x+4,y,   x+6,y+2);
  35.              gc.drawLine(x+6,y+2, x+5,y+4);
  36.              gc.drawLine(x+5,y,   x+7,y+2);
  37.              gc.drawLine(x+7,y+2, x+4,y+4);
  38.              gc.drawString(chevronString, x+7, y+3, true);
  39. +            gc.setFont(oldFont);
  40.              break;
  41.          }
  42.          case HOT: {
  43.              gc.setForeground(display.getSystemColor(BUTTON_BORDER));
  44.              gc.setBackground(display.getSystemColor(BUTTON_FILL));
  45. +            Font oldFont = gc.getFont();
  46.              gc.setFont(f);
  47.              gc.fillRoundRectangle(chevronRect.x, chevronRect.y, chevronRect.width, chevronRect.height, 6, 6);
  48.              gc.drawRoundRectangle(chevronRect.x, chevronRect.y, chevronRect.width - 1, chevronRect.height - 1, 6, 6);
  49.              gc.drawLine(x,y,     x+2,y+2);
  50.              gc.drawLine(x+2,y+2, x,y+4);
  51.              gc.drawLine(x+1,y,   x+3,y+2);
  52.              gc.drawLine(x+3,y+2, x+1,y+4);
  53.              gc.drawLine(x+4,y,   x+6,y+2);
  54.              gc.drawLine(x+6,y+2, x+5,y+4);
  55.              gc.drawLine(x+5,y,   x+7,y+2);
  56.              gc.drawLine(x+7,y+2, x+4,y+4);
  57.              gc.drawString(chevronString, x+7, y+3, true);
  58. +            gc.setFont(oldFont);
  59.              break;
  60.          }
  61.          case SELECTED: {
  62.              gc.setForeground(display.getSystemColor(BUTTON_BORDER));
  63.              gc.setBackground(display.getSystemColor(BUTTON_FILL));
  64. +            Font oldFont = gc.getFont();
  65.              gc.setFont(f);
  66.              gc.fillRoundRectangle(chevronRect.x, chevronRect.y, chevronRect.width, chevronRect.height, 6, 6);
  67.              gc.drawRoundRectangle(chevronRect.x, chevronRect.y, chevronRect.width - 1, chevronRect.height - 1, 6, 6);
  68.              gc.drawLine(x+1,y+1, x+3,y+3);
  69.              gc.drawLine(x+3,y+3, x+1,y+5);
  70.              gc.drawLine(x+2,y+1, x+4,y+3);
  71.              gc.drawLine(x+4,y+3, x+2,y+5);
  72.              gc.drawLine(x+5,y+1, x+7,y+3);
  73.              gc.drawLine(x+7,y+3, x+6,y+5);
  74.              gc.drawLine(x+6,y+1, x+8,y+3);
  75.              gc.drawLine(x+8,y+3, x+5,y+5);
  76.              gc.drawString(chevronString, x+8, y+4, true);
  77. +            gc.setFont(oldFont);
  78.              break;
  79.          }
  80.      }
  81.      f.dispose();
  82.  }
  83.  void drawMaximize(GC gc) {
  84. diff -u6r org/eclipse/swt/widgets/Widget.java org/eclipse/swt/widgets/Widget.java
  85. --- org/eclipse/swt/widgets/Widget.java    2006-02-01 12:17:21.171875000 +0900
  86. +++ org/eclipse/swt/widgets/Widget.java    2006-02-14 22:57:41.437500000 +0900
  87. @@ -2028,13 +2028,14 @@
  88.              OS.GetRgnBox (rgn, rect);
  89.              int width = rect.right - rect.left;
  90.              int height = rect.bottom - rect.top;
  91.              if (width != 0 && height != 0) {
  92.                  int hDC = gc.handle;
  93.                  OS.SelectClipRgn (hDC, rgn);
  94. -                OS.SetMetaRgn (hDC);
  95. +                //XXX Win98 Resource Leak
  96. +                //OS.SetMetaRgn (hDC);
  97.                  Event event = new Event ();
  98.                  event.gc = gc;
  99.                  event.x = rect.left;
  100.                  event.y = rect.top;
  101.                  event.width = width;
  102.                  event.height = height;
  103.